package game

import "sync"

// 一些任务状态信息
const (
	TASK_STATE_INIT   = 0
	TASK_STATE_DOING  = 1
	TASK_STATE_FINISH = 2
)

type TaskInfo struct {
	TaskId int
	State  int
}

type ModUniqueTask struct {
	TaskInfo map[int]*TaskInfo
	Locker   *sync.RWMutex // 读写锁
}

// 判断任务是否完成
func (self *ModUniqueTask) IsTaskFinished(taskId int) bool {
	task, ok := self.TaskInfo[taskId]
	if !ok {
		return false
	}
	return task.State == TASK_STATE_FINISH
}
